
import request from '@/api/index.js'
const state = {
 catData:{},
 }
const mutations = {
	SET_CATNAME(state,catData){
		state.catData = catData
	}
}
const actions = {
	async getcatDataList({commit}){
		const result = await request('/categories')
		commit('SET_CATNAME',result)
	}
}
const getters = {
	leftList(state){
		return state.catData.message||[]
	},
	chlidrenList(state){
		return ((state.catData .message || [])[0] || []).children || []
	},
}

export default{
	namespaced:true,
	state,
	mutations,
	actions,
	getters
}